package com.aspose.cells;

import java.awt.Graphics;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.awt.image.IndexColorModel;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.ParameterBlock;
import javax.media.jai.ColorCube;
import javax.media.jai.ImageLayout;
import javax.media.jai.JAI;
import javax.media.jai.KernelJAI;
import javax.media.jai.RenderedOp;

class zafm {
   static RenderedImage a(com.aspose.cells.b.a.b.za var0) {
      BufferedImage var1 = new BufferedImage(var0.i(), var0.h(), 10);
      Graphics var2 = var1.getGraphics();
      var2.drawImage(var0.f(), 0, 0, (ImageObserver)null);
      ParameterBlock var3 = new ParameterBlock();
      var3.addSource(var1);
      String var4 = null;
      var4 = "ordereddither";
      ColorCube var5 = ColorCube.createColorCube(0, 0, new int[]{2});
      var3.add(var5);
      var3.add(KernelJAI.DITHER_MASK_441);
      ImageLayout var6 = new ImageLayout();
      byte[] var7 = new byte[]{0, -1};
      IndexColorModel var8 = new IndexColorModel(1, 2, var7, var7, var7);
      var6.setColorModel(var8);
      RenderingHints var9 = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, var6);
      RenderedOp var10 = JAI.create(var4, var3, var9);
      var2.dispose();
      return var10;
   }
}
